package com.ruoyi.common.exception.base.service;

import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.StringUtils;

/**
 * 业务异常
 * 
 * @author ruoyi
 */
public final class ServiceException extends BaseException
{
    private static final long serialVersionUID = 1L;

    /**
     * 错误明细，内部调试错误
     *
     * 和 {@link Common Result#getDetailMessage()} 一致的设计
     */
    private String detailMessage;

    /**
     * 空构造方法，避免反序列化问题
     */
    public ServiceException()
    {
        this("业务异常,请联系管理员！");
    }

    public ServiceException(String message,Object... args)
    {
        super(StringUtils.format(message,args));
    }

    public String getDetailMessage()
    {
        return detailMessage;
    }

    public ServiceException setDetailMessage(String detailMessage)
    {
        this.detailMessage = detailMessage;
        return this;
    }

}